platform(
    name = "macos",
    constraint_values = [
        "@platforms//os:macos",
    ],
)

platform(
    name = "linux",
    constraint_values = [
        "@platforms//os:linux",
    ],
)

platform(
    name = "aarch64",
    constraint_values = [
        "@platforms//cpu:aarch64",
    ],
)

platform(
    name = "x86_64",
    constraint_values = [
        "@platforms//cpu:x86_64",
    ],
)

platform(
    name = "macos_x86_64",
    constraint_values = [
        "@platforms//cpu:x86_64",
    ],
    parents = [
        ":macos",
    ],
    visibility = ["//visibility:public"],
)

platform(
    name = "macos_aarch64",
    constraint_values = [
        "@platforms//cpu:aarch64",
    ],
    parents = [
        ":macos",
    ],
    visibility = ["//visibility:public"],
)

platform(
    name = "ios",
    constraint_values = [
        "@platforms//os:ios",
        # This constraint is needed to indicate that it doesn't target the
        # simulator.
        # See https://github.com/bazelbuild/apple_support/blob/34373b2404e35cdbf94e7b59d667a2c6920eac4d/constraints/BUILD#L18
        # for more information.
        "@build_bazel_apple_support//constraints:device",
    ],
    parents = [":aarch64"],
    visibility = ["//visibility:public"],
)

platform(
    name = "linux_x86_64",
    constraint_values = [
        "@platforms//cpu:x86_64",
    ],
    parents = [
        ":linux",
    ],
    visibility = ["//visibility:public"],
)
